package com.project.biz;

import com.baomidou.mybatisplus.extension.service.IService;
import com.project.entity.CmsUserBalance;

import java.math.BigDecimal;

/**
 * @Description: 用户余额接口类
 * @Author: zhuchi
 * @CreateDate: 2020/9/10 16:33
 * @Version: 1.0
 */
public interface CmsUserBalanceBiz extends IService<CmsUserBalance> {

    /**
     * 获取用户余额
     * @param userId
     * @return
     */
    BigDecimal getUserBalance(Long userId);

    /**
     * 增加用户余额
     * @param userId
     * @param addMoney
     * @return
     */
    int updateAddUserBalance(Long userId, BigDecimal addMoney);

    /**
     * 减少用户余额
     * @param userId
     * @param subMoney
     * @return
     */
    int updateSubUserBalance(Long userId, BigDecimal subMoney);

    /**
     * 获取用户冻结金额
     * @param userId
     * @return
     */
    BigDecimal getUserFrozenAmount(Long userId);

    /**
     * 增加用户冻结金额
     * @param userId
     * @param addMoney
     * @return
     */
    int updateAddUserFrozenAmount(Long userId, BigDecimal addMoney);

    /**
     * 减少用户冻结金额
     * @param userId
     * @param subMoney
     * @return
     */
    int updateSubUserFrozenAmount(Long userId, BigDecimal subMoney);

    /**
     * 初始化用户金额记录
     * @param userId
     * @return
     */
    CmsUserBalance addUserBalance(Long userId);

}
